<html>
<body><br>
<table class="mytable">
<tr>    
    <th align="center">Name</th>
    <th align="center">Category</th>    
    <th align="center">Producer</th>    
    <th align="center">Url</th>
    <th align="center">Price</th>
    <th align="center">Warranty</th>
    <th align="center">&nbsp;</th>
</tr><tr>
<?php
if (count($this->paginator)):
    $cate = new Category(); // for retrieve category name
    $producer = new Producer(); // for retrieve producer name
    foreach ($this->paginator as $pro):    
?>
<tr>    
    <td><?php echo $this->escape($pro->name);?></td>
    <td><?php $cateRow = $cate->fetchRow('id='.$pro->category_id); echo $this->escape($cateRow->name);?></td>    
    <td><?php $proRow = $producer->fetchRow('id='.$pro->producer_id); echo $this->escape($proRow->name);?></td>
    <td><?php echo $this->escape($pro->url);?></td>
    <td><?php echo $this->escape($pro->price);?></td>            
    <td><?php echo $this->escape($pro->warranty);?></td>
    <td>
        <a href="<?php echo $this->url(array('controller'=>'product',
            'action'=>'update', 'id'=>$pro->id));?>">Edit</a>
        <a href="<?php echo $this->url(array('controller'=>'product',
            'action'=>'delete', 'id'=>$pro->id));?>">Delete</a>
    </td>
</tr>
<?php endforeach; echo "</tr></table>"; endif; ?><hr>
<a href="<?php echo $this->url(array('action'=>'add')); ?>">Add new product</a>
<?= $this->paginationControl($this->paginator,
                             'Sliding',
                             'pagination.phtml'); ?>
</body>
</html>